# adb
set(MOBILE_COMMON_ADB_SOURCES
        adb/adbprocess.h
        adb/adbprocess.cpp
        )
source_group(adb FILES ${MOBILE_COMMON_ADB_SOURCES})

set(MOBILE_COMMON_UIBASE_SOURCES
        uibase/tipwidget.h
        uibase/tipwidget.cpp
        uibase/loadanimation.h
        uibase/loadanimation.cpp
        )
source_group(uibase FILES ${MOBILE_COMMON_UIBASE_SOURCES})

set(MOBILE_COMMON_SOURCES
        config.h
        config.cpp
        fileinfo.h
        fileinfo.cpp
        fileinfolist.h
        fileinfolist.cpp
        generatetools.h
        generatetools.cpp
        highlight-effect.h
        serverstatus.h
        serverstatus.cpp
        util.h
        util.cpp)

set(MOBILE_COMMON
        ${MOBILE_COMMON_ADB_SOURCES}
        ${MOBILE_COMMON_UIBASE_SOURCES}
        ${MOBILE_COMMON_SOURCES}
)

set(TOP_DIR ${CMAKE_CURRENT_LIST_DIR})

add_library(mobile_common ${MOBILE_COMMON})

find_package(Qt5DBus COMPONENTS Dbus REQUIRED)
find_package(PkgConfig REQUIRED)

pkg_check_modules(KYSDK_DIAGNOSTICS kysdk-diagnostics)
target_include_directories(mobile_common PUBLIC ${KYSDK_DIAGNOSTICS_INCLUDE_DIRS})
target_link_directories(mobile_common PUBLIC ${KYSDK_DIAGNOSTICS_LIBRARY_DIRS})
target_link_libraries(mobile_common PUBLIC ${KYSDK_DIAGNOSTICS_LIBRARIES})

target_include_directories(mobile_common PUBLIC adb)
target_include_directories(mobile_common PUBLIC uibase)
target_include_directories(mobile_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_include_directories(mobile_common PUBLIC ${TOP_DIR}/../kabase/)

target_link_libraries(mobile_common PUBLIC
        Qt${QT_VERSION_MAJOR}::Widgets
        Qt${QT_VERSION_MAJOR}::Network
        ${Qt5DBus_LIBRARIES}
        qrencode
        )

